//
//  MainViewController.m
//  Butler
//
//  Created by liaozhenming on 16/6/8.
//  Copyright © 2016年 liaozhenming. All rights reserved.
//

#import "MainViewController.h"

#import "BusinessViewController.h"
#import "PannelViewController.h"
#import "StatisticsViewController.h"
#import "OrderViewController.h"

#import "KKSplitAnimationModel.h"
#import "KKBusinessView.h"

@interface MainViewController ()<UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout>

@property (nonatomic, strong)KKBusinessView *businessView;
@end

@implementation MainViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    // Do any additional setup after loading the view.
//    _businessView = [[KKBusinessView alloc] initWithFrame: CGRectMake(0, 0, SCREEN_WIDTH - 200, 150)];
//    _businessView.itemCollectionView.delegate = self;
//    _businessView.itemCollectionView.dataSource = self;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Action methods

- (IBAction)action_business:(id)sender {
    
//    [KKSplitAnimationModel kk_splitAnimationWithTargetView: self.view eventControl: sender crackView: _businessView];
    OrderViewController *viewController = [OrderViewController kk_viewControllerFromStoryboard];
    [self kk_pushViewController: viewController];
}

- (IBAction)action_manger:(id)sender {

    PannelViewController *viewController = [PannelViewController kk_viewControllerFromStoryboard];
    [self kk_pushViewController: viewController];
}

- (IBAction)action_statistics:(id)sender {

    StatisticsViewController *viewController = [StatisticsViewController kk_viewControllerFromStoryboard];
    [self kk_pushViewController: viewController];
}

#pragma mark - UICollectionViewDelegate methods

- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
    
    return 10;
}

- (UICollectionViewCell*)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    
    BusinessItemCollectionViewCell *cell = [BusinessItemCollectionViewCell kk_cellWithCollectionView: collectionView indexPath: indexPath];
    cell.backgroundColor = [UIColor yellowColor];
    return cell;
}

- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
    
    OrderViewController *viewController = [OrderViewController kk_viewControllerFromStoryboard];
    [self kk_pushViewController: viewController];
}

@end
